import { http } from '@/utils/http/axios';

const prefix = "http://localhost";

/**
 * @categoryName 根据用户id获取用户菜单
 */
export function findDictChildData(id: string) {
  return http.request({
    url: `${prefix}/admin/cmn/dict/findChildData/${id}`,
    method: 'GET',
  }).then(res => {
    res.data.forEach(r => {
      r.isLeaf = !r.hasChildren
    })
    return res;
  });
}


export function exportData() {
  window.location.href = prefix + '/admin/cmn/dict/exportData'
}

export function importDataUrl() {
  return prefix + "/admin/cmn/dict/importData"
}
